From 21136d2335a289636af61d69ac895d988ae15488 Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Mon, 13 Nov 2017 15:43:12 -0700 Subject: [PATCH] use locale independent string for gopal tracklog. --- gopal.cc | 12 +++++++++--- reference/gopal-11-gpx.gpx | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gopal.cc b/gopal.cc index 8438342b1..ff5f9b2b3 100644 --- a/gopal.cc +++ b/gopal.cc @@ -57,6 +57,8 @@ #include #include #include +#include +#include #define MYNAME "gopal" static gbfile* fin, *fout; @@ -64,7 +66,6 @@ static gbfile* fin, *fout; static struct tm tm,filenamedate, trackdate; time_t tx; char tmp[64]; -char routename[64]; static char* optdate=NULL; static char* optmaxspeed=NULL; static char* optminspeed=NULL; @@ -179,10 +180,15 @@ gopal_read() char tbuffer[64]; struct tm tm2; lat_old=0; - strftime(routename,sizeof(routename),"Tracklog %c",gmtime(&tx)); + route = route_head_alloc(); - route->rte_name = routename; + QDateTime qtx; + qtx.setTimeSpec(Qt::UTC); + qtx.setTime_t(tx); + route->rte_name = "Tracklog "; + route->rte_name += qtx.toString(Qt::ISODate); + route_add_head(route); line=0; diff --git a/reference/gopal-11-gpx.gpx b/reference/gopal-11-gpx.gpx index 4e305e9d8..e6bd15b4a 100644 --- a/reference/gopal-11-gpx.gpx +++ b/reference/gopal-11-gpx.gpx @@ -73,7 +73,7 @@ 0.766000 - Tracklog Thu Jan 1 00:00:00 1970 + Tracklog 1970-01-01T00:00:00Z 341.950000 -- 2.30.2